﻿using System;
using System.Web.UI;
using System.Reflection;
using System.Text;
using System.IO;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Json;
using System.Collections.Generic;

using ExtraClub.Domain;
using ExtraClub.Domain.Entities;

using SubSonic;
using ExtraClub.Domain.Forms;

namespace ExtraClub.Web.Forms.sign_up {
    public partial class module : BaseForm {
        protected override void OnInit(EventArgs e) {
            base.OnInit(e);
            LoadAssets();

            ResisterWSFile("modules/forms/sign_up/module.asmx");

            CommandPanel.HideUpdate = true;
            CommandPanel.HideDelete = true;
        }
 
        public string SetFields() {
            string ret = "null";
            switch (CurrentCommand) {
                case ECommand.New:
                    ret = BuildForm(false);
                    break;
            }
            return ret;
        }
       //CellularPhone, HomePhone
        private string BuildForm(bool edit) {
            FieldCollection fs = new FieldCollection();

            /* User Name */
            Field user_name = new Field(FieldType.String);
            user_name.Label = UIText["user-name-label"];
            user_name.CodeName = "user_name";
            user_name.Size = 20;
            user_name.Required = true;
            fs.Add(user_name.ToJSON());

            /* Email */
            Field email = new Field(FieldType.Email);
            user_name.Label = UIText["email-label"];
            user_name.CodeName = "email";
            user_name.Size = 50;
            user_name.Required = true;
            fs.Add(user_name.ToJSON());

            return fs.JSON();

        }
    }
}
